import type { RouteRecordRaw, RouteLocationNormalized } from 'vue-router';

const currentDeck: RouteRecordRaw[] = [
  {
    path: '/currentdeck/:game_id',
    name: 'CurrentDeckListPage',
    component: () => import('/@/views/currentDeck/deck'),
    meta: {
      title: '套牌',
    },
    props: (router: RouteLocationNormalized) => {
      return {
        gameId: router.params.game_id ? String(router.params?.game_id) : '',
      };
    },
  },
  {
    path: '/currentdeckdetail/:deck_id',
    name: 'CurrentDeckDetailPage',
    component: () => import('/@/views/currentDeck/deckDetail'),
    meta: {
      title: '套牌详情',
    },
    props: (router: RouteLocationNormalized) => {
      return {
        deckId: router.params.deck_id ? String(router.params?.deck_id) : 0,
        share: router.query.share || '',
        gameId: router.query.gameid || '',
      };
    },
  },
  {
    path: '/currentdeckcreate/:deck_id?',
    name: 'CurrentDeckCreatePage',
    component: () => import('/@/views/currentDeck/deckCreate'),
    meta: {
      title: '创建套牌',
    },
    props: (router: RouteLocationNormalized) => {
      return {
        deckId: router.params.deck_id ? String(router.params?.deck_id) : '',
      };
    },
  },
  {
    path: '/currentdeckcard/',
    name: 'CurrentDeckCardPage',
    component: () => import('/@/views/currentDeck/deckCard'),
    meta: {
      title: '选择卡牌',
    },
  },
  {
    path: '/currentdeckimage/:deck_id/:small?',
    name: 'CurrentDeckImagePage',
    component: () => import('/@/views/currentDeck/deckImage'),
    meta: {
      title: '套牌图片',
    },
    props: (router: RouteLocationNormalized) => {
      return {
        deckId: router.params.deck_id ? String(router.params?.deck_id) : 0,
        small: !!router.params.small,
      };
    },
  },
];
export default currentDeck;
